import {CodeScanResult, Issue, RedlineResult} from './redline'

export function generateReadlineResults(codeScanResult: CodeScanResult) {
    const issue = codeScanResult.issue as Issue
    const total = {
        key: 'Total',
        title: 'issue',
        style: 'text-danger',
        value: issue.total
    } as RedlineResult

    const blocker = {
        key: 'Blocker',
        title: 'issue',
        style: 'text-danger',
        value: issue.blocker
    } as RedlineResult

    const critical = {
        key: 'Critical',
        title: 'issue',
        style: 'text-danger',
        value: issue.critical
    } as RedlineResult

    const major = {
        key: 'Major',
        title: 'issue',
        style: 'text-danger',
        value: issue.major
    } as RedlineResult
    const redlineResults = [total, blocker, critical, major]
    return redlineResults
}